<?php
	include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
	if (function_exists("autorisation")) autorisation("dc_newsletter_basic");
	include_once(realpath(dirname(__FILE__)) . '/../Dc_newsletter_basic.class.php');
	header("Content-Type: application/csv-tab-delimited-table");
	header("Content-disposition: filename=export_newsletter" . ".csv");

	$newsletter = new dc_newsletter_basic();
	$query_newsletter = "select * from $newsletter->table";
	$resul_newsletter = mysql_query($query_newsletter, $newsletter->link);

	while($row = mysql_fetch_object($resul_newsletter)) {
		echo $row->email .";". $row->nom .";". $row->prenom .";". $row->date .";". $row->langue . "\n";
	}
?>
